<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'AfterLogin.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link rel="stylesheet" type="text/css" href="<%=basePath%>/css/biaoge.css"/>
<script type="text/javascript" src="jquery/js/jquery-1.8.2.js"></script>
  </head>
   <script type="text/javascript">
   function xiangxi(username){
   $.post(
   				"getreContent.action",
   				{bename:username},  
          		function xiang(data){
          		if(data.content!=null&&data.content!=""){
            /*      var x=event.x;
		         var y=event.y;
		        var div=document.createElement("div");
		        div.innerHTML=data.content; */
		        alert(data.content);
		        
	       }
          	   
					///var len=data.jsonob.length;
					//for(var i=0;i<len;i++){
				  /* 
					var	li= document.createElement("li");
					li.innerHTML=data.content;
					div.appendChild(li); */
						/*var v="javascript:void(0);"+" "+"onclick=SendCar(data.jsonob[i].seriesName)";*/
						//li.innerHTML="<a href='javascript:void(0);'>"
					  //  +data.jsonob[i].seriesName+"</a>";
						//li.onclick=function(event){
							//alert(event.target.innerHTML);
							//alert(data.jsonob[i].seriesName);
							//SendCar(event.target.innerHTML);
						///};
					 	//uu.appendChild(li);
					},
					//ss.setAttribute("isclick","true");
	   		  "json" );  
 }
  
   
 function ju(){
    window.location="showReport.action";
  }
  function cha(){
 
   window.location="showCustomer.action";
     
  }
  
  function g(){
    window.location="showindustry.action";
  }
  
function quan(){
     window.location="showcuslimit.action";
  }
 function chaxun(){
  var name=$("#uname").val();
   window.location="searchcuslimit.action?username="+name;
 }
  function xiu(name){
  if(confirm("确定要修改他的权限吗？")){
  //var name=$("#hid").val();
  var can=document.getElementsByName(name);
  var fen,ping,ju,ding;
  // var fen=can[0].value; var ping=can[1].value;var ju=can[2].value;var ding=can[3].value;
  
  if(can[0].checked) fen=1;else fen=0;
  if(can[1].checked) ping=1;else ping=0;
  if(can[2].checked) ju=1;else  ju=0;//can[2].checked=false;
  if(can[3].checked) ding=1;else ding=0;//can[3].checked=false;  */
  /*
   var fen=$("#fen").val();
   var ding=$("#ding").val();
    var ju=$("#ju").val();
     var pin=$("#pin").val();*/
   //alert(name+","+fen+","+ping+","+ju+","+ding); 
   var tt=name+","+fen+","+ping+","+ju+","+ding;
   window.location='updatelimit.action?quanbu='+tt;
    
   }
  }
  
   function kai(a){
   var k=document.getElementById("zuihou");
  if(a<=1) k.innerHTML="这已经第一页了";
  }
  function zui(a,b){
  var z=document.getElementById("zuihou");
  if(a>=b) z.innerHTML="这已经是最后一页了";
  }
  </script>
  <body>
   
   	<div style="width:900px; float:right;margin-top: 30px" id="chakan">
      <input type="button" value="查询用户" onclick="chaxun()" style="float:right; margin-top: 5px"><input type="text" name="uname" id="uname" style="float:right; margin-top: 5px"><br>
    
    <table id="mytable" cellspacing="10">
  <tr>
  <td>用户名</td> <td>现有权限(可以勾选进行修改)</td><td>举报失败次数</td><td>被举报次数(鼠标移动相应位置可查看原因)</td><td>修改权限</td></tr>
   <c:forEach items="${comlist}" var="cli"> 
  <tr>
  <td>${cli.username}</td>             
   <td>
  <c:if test="${cli.canshare==1}">
         <input type="checkbox" id="fen" name="${cli.username}"  value="1" checked="checked">分享
  </c:if>
  <c:if test="${cli.canshare==0}">
         <input type="checkbox"  value="0" name="${cli.username}"  >分享
  </c:if>
  <c:if test="${cli.cancomment==1}">
       <input type="checkbox" id="pin" name="${cli.username}"   value="1" checked="checked"> 评论
  </c:if>
  <c:if test="${cli.cancomment==0}">
       <input type="checkbox"  value="0" name="${cli.username}"  > 评论
  </c:if>
  <c:if test="${cli.canreport==1}">
         <input type="checkbox"  name="${cli.username}" value="1"  checked="checked">举报
  </c:if>
  <c:if test="${cli.canreport==0}">
         <input type="checkbox" id="ju" value="0" name="${cli.username}"  >举报
  </c:if>
  <c:if test="${cli.cancustom==1}">
        <input type="checkbox" id="ding" name="${cli.username}"  value="1" checked="checked">定制    
  </c:if>
  <c:if test="${cli.cancustom==0}">
        <input type="checkbox"  value="0" name="${cli.username}" >定制    
  </c:if>
  </td>  
   <td>${cli.reportcount}</td>
   <td onmouseover="xiangxi('${cli.username}')">${cli.bereportedcount}</td> 	
   <td> <input type="button" style="border-style:none" value="修改" 
   onclick="xiu('${cli.username}')"></td>
  </tr>
  </c:forEach>
  
  </table>
  <br>
 <div style="margin-left: 200px">
 <a href="showcuslimit?page=1"> 首页</a>&lt;<a href="showcuslimit?page=${pagenow-1}" onclick="kai(${pagenow})">上一页</a>
							<strong>第${pagenow}页/共${pagecount}页</strong>
							<a href="showcuslimit?page=${pagenow+1}" onclick="zui(${pagenow},${pagecount})"> 下一页</a>&gt;
							<a href="showcuslimit?page=${pagecount}">末页</a>&gt;&gt;
						</p>
						<font size="2" color="red" id="zuihou"></font>
						</div>
   	</div>
   
  </body>
</html>
